package daily;

import java.util.Scanner;

public class MeiTuan01 {

    public static void main(String[] args){

        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[][] in = new int[n][];
        for(int i = 0; i < n; i++){
            int m = sc.nextInt();
            int[] nums = new int[m];
            for(int j = 0; j < m; j++){
                nums[j] = sc.nextInt();
            }
            in[i] = nums;
        }
        for(int i = 0; i < n; i++){
            check(in[i], in[i].length);
        }
    }

    private static void check(int[] nums, int n){
        boolean[] checkNum = new boolean[n+1];
        for(int i = 0; i < n; i++){
            int j = nums[i];
            if(j > n || j <= 0 || checkNum[j]){
                System.out.println("No");
                return;
            }
            checkNum[j] = true;
        }
        System.out.println("Yes");
    }

    /**

     2
     3
     2 1 1
     4
     4 2 2 3


     */
}
